/*
 * @Author: taoshiwei
 * @Date: 2019-04-09 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:56:00
 *
 * 目录
 */

import request from '@/utils/request'

// 目录列表
// export const list = data => request('/directorys', 'get', data)

export function loadDirectorys(params) {
  return request({
    url: '/directorys',
    params
  })
}

// 目录简单列表
// export const simple = data => request('/directorys/simple', 'get', data)
export function simple(params) {
  return request({
    url: '/directorys/simple',
    params
  })
}

// 目录详情
// export const detail = data => request(`/directorys/${data.id}`, 'get', data)
export function detail(data) {
  return request({
    url: `/directorys/${data.id}`,
    data
  })
}

// 目录添加
// export const add = data => request('/directorys', 'post', data)
export function add(data) {
  return request({
    url: '/directorys',
    method: 'post',
    data
  })
}
// 目录修改
// export const update = data => request(`/directorys/${data.id}`, 'put', data)
export function update(data) {
  return request({
    url: `/directorys/${data.id}`,
    method: 'put',
    data
  })
}
// 目录删除
// export const remove = data => request(`/directorys/${data.id}`, 'delete', data)
export function remove(data) {
  return request({
    url: `/directorys/${data.id}`,
    method: 'delete',
    data
  })
}
// 目录状态
// export const changeState = data => request(`/directorys/${data.id}/${data.state}`, 'post', data)
export function changeState(data) {
  return request({
    url: `/directorys/${data.id}/${data.state}`,
    method: 'post',
    data
  })
}
